/*
 * @lc app=leetcode.cn id=1446 lang=cpp
 *
 * [1446] 连续字符
 */

// @lc code=start
class Solution
{
public:
    int maxPower(string s)
    {
        //太简单了
        int num = 1;
        char tmp = s[0];
        int maxnum = 1;
        for (int i = 1; i < s.size(); i++)
        {
            if (tmp == s[i])
            {
                num++;
            }
            else
            {
                maxnum = max(maxnum, num);
                tmp = s[i];
                num = 1;
            }
        }
        return max(maxnum,num);
    }
};
// @lc code=end
